package com.liit.module.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.liit.module.dao.DictDao;
import com.liit.module.entity.Dict;
import com.liit.module.frame.utils.page.Pagination;
import com.liit.module.service.DictService;

/**
 * @author dingweibo
 * @Title: DictServiceImpl.java
 * @Description: TODO(用一句话描述该文件做什么)
 * @date 2015年11月28日
 */
@Service("dictService")
public class DictServiceImpl implements DictService {
	@Autowired
	private DictDao dictDao;

	@Override
	public Integer saveDict(Dict entity) throws Exception {
		return dictDao.saveDict(entity);
	}

	@Override
	public Integer updateDictById(Dict entity) throws Exception {
		return dictDao.updateDictById(entity);
	}

	@Override
	public Dict selectDictById(Object id) throws Exception {
		return dictDao.selectDictById(id);
	}

	@Override
	public List<Dict> selectByColumn(String column) {
		return dictDao.selectByColumn(column);
	}

	@Override
	public Map<String, Object> listPage(Pagination pagination, Dict dict) {
		Map<String, Object> result = new HashMap<String, Object>();
		result.put("list", dictDao.listPage(pagination, dict));
		result.put("page", pagination);
		return result;
	}

	@Override
	public Integer selectMaxValueByColumn(String column) {
		return dictDao.selectMaxValueByColumn(column);
	}
}
